package cn.tedu.plus.sort;

import java.util.Arrays;
import java.util.Random;

public class SelectionSort2 {
    public static void main(String[] args) {
        Random random = new Random();
        int[] array = new int[1000];
        for (int i = 0; i < 1000; i++) {
            array[i]=random.nextInt(100);
        }
        System.out.println(Arrays.toString(array));

        Long countNum = 0L;
        Long swapNum =0L;
        Long startTime = System.currentTimeMillis();

        for (int i = 0; i < array.length; i++) {
            for (int j = i + 1; j < array.length; j++) {
                if(array[i] < array[j]){
                    int temp = array[i];
                    array[i] = array[j];
                    array[j] = temp;
                }
            }
        }
        System.out.println(Arrays.toString(array));
    }
}
